package structural.composite;

import java.util.ArrayList;

public class Equip extends AbstractEquip{

    public Equip(String n, String b) {
        super(n, b);
        super.subEquipList = new ArrayList<>();
    }

    @Override
    public AbstractEquip addChild(AbstractEquip child) {
        super.subEquipList.add(child);
        return this;
    }

    @Override
    protected void printAdditional() {
        System.out.println("设备类型：机器人。");
        System.out.println("####开始打印子设备信息####");
        super.subEquipList.stream().forEach(AbstractEquip::print);
    }
}
